<!DOCTYPE html>
<html>
<head>
<base href="${basePath}">
<meta charset="UTF-8">
<title>创建活动</title> $!{include("import_js_css.html")}
</head>
<body>
	${include("header.html")}
	<div class="menu_all">
		<div class="div_search_result clear">
			<div class="panel-heading" style="background: #E9E9E9;">
				<h3 class="panel-title">创建活动</h3>
			</div>
			<div class="panel-form-add">
				<form class="form-horizontal" role="form" name="addLiftClub"
					action="yueyogaAdmin/addLiftClubs.jhtml" method="post">
					<div class="panel-form-layout">
						<label for="inputLiftClubName"
							class="col-sm-1 control-label"><font color="red">*</font>活动主题</label>
						<div class="col-sm-3">
							<input type="text" class="form-control" name="liftClubName"
								id="inputLiftClubName" value="${liftclubname}" required>
						</div>
						<label for="inputLiftClubState" class="col-sm-1 control-label">活动状态</label>
						<div class="col-sm-3">
							<select id="inputLiftClubState"
								class="selectpicker show-tick" data-width="100%"
								name="LiftClubState">
								<option value=""> </option>
								<option value="0">准备中</option>
								<option value="1">进行中</option>
							</select>
						</div>
						<br /> <br /> <label for="inputCoach0"
							class="col-sm-1 control-label">活动老师</label>
						<div class="col-sm-3">
							<select id="inputCoach0" data-live-search="true"
								class="selectpicker show-tick" data-width="100%"
								name="coachType0Id">
								<option value=""> </option>
								<!-- #foreach(Coach ch0 : listCoach0) -->
								<option value="${ch0.coachId}">${ch0.name}</option>
								<!-- #end -->
							</select>
						</div>

						<label for="inputCoach1" class="col-sm-1 control-label">活动助教</label>
						<div class="col-sm-3">
							<select id="inputCoach1" data-live-search="true"
								class="selectpicker show-tick" data-width="100%"
								name="coachType1Id">
								<option value=""> </option>
								<!-- #foreach(Coach ch1 : listCoach1) -->
								<option value="${ch1.coachId}">${ch1.name}</option>
								<!-- #end -->
							</select>
						</div>
						<br /> <br /> <label for="inputResponsible"
							class="col-sm-1 control-label"><font color="red">*</font>负责人</label>
						<div class="col-sm-3">
							<select id="inputResponsible" data-live-search="true"
								class="selectpicker show-tick" data-width="100%"
								name="responsibleId" required>
								<option value=""> </option>
								<!-- #foreach(GroupUserModel responsible : responsibles) -->
								<option value="${responsible.id}">${responsible.name}</option>
								<!-- #end -->
							</select>
						</div>
						<label for="inputPlacement" class="col-sm-1 control-label">活动场地</label>
						<div class="col-sm-3">
							<select id="inputPlacement" data-live-search="true"
								class="selectpicker show-tick" data-width="100%" name="placeId">
								<option value=""> </option>
								<!-- #foreach(Place place : listPlace) -->
								<option value="${place.id}">${place.name}</option>
								<!-- #end -->
							</select>
						</div>
						<br /> <br /> <label for="inputStartDate"
							class="col-sm-1 control-label">开始时间</label>
						<div class="col-sm-3">
							<div class='input-group date' id='inputStartDate'
								data-date-format="YYYY-MM-DD HH:mm">
								<input name="startdate" type='text' class="form-control"
									id="startDate" value="${clubStartDate}"/> <span
									class="input-group-addon"><span
									class="glyphicon glyphicon-time"></span> </span>
							</div>
						</div>
						<label for="inputendDate" class="col-sm-1 control-label">结束时间</label>
						<div class="col-sm-3">
							<div class='input-group date' id='inputendDate'
								data-date-format="YYYY-MM-DD HH:mm">
								<input name="enddate" type='text' value="${clubEndDate}"
									id="endDate" class="form-control" /> <span
									class="input-group-addon"><span
									class="glyphicon glyphicon-time"></span> </span>
							</div>
						</div>
						<br /> <br /> <label for="inputCreditlimits"
							class="col-sm-1 control-label">积分下限</label>
						<div class="col-sm-3">
							<input type="text" class="form-control" name="creditlimits"
								id="inputCreditlimits" value="${clubCreditlimits}">
						</div>
						<br /> <br />
						 <label for="txtRemarks" class="col-sm-1 control-label">备注</label>
						<div class="col-sm-3">
							<textarea class="form-control panel-form-addreed" style="width:665px !important;" name="remarks" id="txtRemarks" ></textarea>
						</div>
						<br /> <br />
						<br /> <br />
						<div class="panel-btn-search">
							<button type="submit" class="btn btn-default btn-ade-default panel-mr">保存</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
</html>
<script type="text/javascript">
	function documentReady() {
		var msg = "${msg}";
		if (msg == "success") {
			window.location.href = "yueyogaAdmin/searchLiftClubs.jhtml";
		} else if (msg == "failure") {
			error("添加活动失败");
		}
	}
	
	$(document).ready(function() {
		$("#inputStartDate").datetimepicker({
			language : "zh-CN"
		});

		$("#inputendDate").datetimepicker({
			language : "zh-CN"
		});

		$("#inputStartDate").on("dp.change", function(e) {
			$("#inputendDate").data("DateTimePicker").setMinDate(e.date);
		});

		$("#inputendDate").on("dp.change", function(e) {
			$("#inputStartDate").data("DateTimePicker").setMaxDate(e.date);
		});
		
		//去掉下拉输入框
		$("#inputLiftClubState").select2({
			width: "100%",
			minimumResultsForSearch: -1
		});
	});

	
	function jf() {
		var jf = $("#inputCreditlimits").val();
		var name = $("#inputLiftClubName").val();
		var start = $("#").val();
		if (!name) {
			alert("请填写主题!");
			return;
		}
		var b = isNaN(jf);
		if (b) {
			alert("请确认积分下限");
			return;
		} else {
			document.addLiftClub.submit();
		}
	}
</script>